#include "ComplexRegular.h"
#include <iostream>
using namespace std;

ComplexRegular::ComplexRegular(int a, int b)
{
        this->a = a;
        this->b = b;
}

ComplexRegular::~ComplexRegular()
{

}

void ComplexRegular::printComplex()
{
        cout<<this->a<<" + "<<this->b<<"i"<<endl;
}

//+
ComplexRegular ComplexRegular::operator+(ComplexRegular &c)
{
        ComplexRegular tmp(this->a+c.a , this->b+c.b);
        return tmp;
}

//-
ComplexRegular ComplexRegular::operator-(ComplexRegular &c)
{
        ComplexRegular tmp(this->a-c.a , this->b-c.b);
        return tmp;
}

//前置++
ComplexRegular& ComplexRegular::operator++()
{
        this->a++;
        this->b++;
        return *this;
}

//后置++
ComplexRegular ComplexRegular::operator++(int)
{
        ComplexRegular tmp = *this;
        this->a++;
        this->b++;
        return tmp;
}

//前置--
ComplexRegular& ComplexRegular::operator--()
{
        this->a--;
        this->b--;
        return *this;
}


//后置--
ComplexRegular ComplexRegular::operator--(int)
{
        ComplexRegular tmp = *this;
        this->a--;
        this->b--;
        return tmp;
}